<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of assembleHistoneDS</title>
  <meta name="keywords" content="assembleHistoneDS">
  <meta name="description" content="Assemble a local representation of the histone modification data for GM06990 cell line (chrm 7), accessed from UCSC Encode DAS server">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="../index.html">code</a> &gt; <a href="index.html">examples</a> &gt; assembleHistoneDS.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for code\examples&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>assembleHistoneDS
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>Assemble a local representation of the histone modification data for GM06990 cell line (chrm 7), accessed from UCSC Encode DAS server</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function [] = assembleHistoneDS() </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Assemble a local representation of the histone modification data for GM06990 cell line (chrm 7), accessed from UCSC Encode DAS server

 assembleHistoneDS() retrieve histone modification data available for 
                     GM06990 cell line, chromosome 7, from UCSC Encode DAS server using 
                     DASMiner API. The function organizes this info in the 
                     'histoneChips' data structure, and save it on GM06990chips_chrm7.mat 

 
 SYNTAX: [] = assembleHistoneDS()

 See also assembleHistoneDSforClustering(),
 performHistoneClustering_Fig4CD()

    DASMiner: DAS library and browser for Matlab.
    Diogo Veiga, Jan 2009.</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
<!-- crossreference -->

<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="#_sub1" class="code">function [chip] = parseHistoneUCSCData(chipLabel)</a></li><li><a href="#_sub2" class="code">function readEncodeRegions(chrm,start,stop,chipLabel)</a></li></ul>
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [] = assembleHistoneDS()</a>
0002 <span class="comment">% Assemble a local representation of the histone modification data for GM06990 cell line (chrm 7), accessed from UCSC Encode DAS server</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% assembleHistoneDS() retrieve histone modification data available for</span>
0005 <span class="comment">%                     GM06990 cell line, chromosome 7, from UCSC Encode DAS server using</span>
0006 <span class="comment">%                     DASMiner API. The function organizes this info in the</span>
0007 <span class="comment">%                     'histoneChips' data structure, and save it on GM06990chips_chrm7.mat</span>
0008 <span class="comment">%</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% SYNTAX: [] = assembleHistoneDS()</span>
0011 <span class="comment">%</span>
0012 <span class="comment">% See also assembleHistoneDSforClustering(),</span>
0013 <span class="comment">% performHistoneClustering_Fig4CD()</span>
0014 <span class="comment">%</span>
0015 <span class="comment">%    DASMiner: DAS library and browser for Matlab.</span>
0016 <span class="comment">%    Diogo Veiga, Jan 2009.</span>
0017 
0018 
0019 <span class="comment">%Entry point for the data structure that holds histone data</span>
0020 <span class="comment">%holds histone modification data for all chips</span>
0021 histoneChips = struct;
0022 
0023 
0024 <span class="comment">%Data for GM06990 cell line,</span>
0025 histoneChips.chips(1) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH3K4me1'</span>);
0026 histoneChips.chips(2) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH3K4me2'</span>);
0027 histoneChips.chips(3) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH3K4me3'</span>);
0028 histoneChips.chips(4) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH3K27me3'</span>);
0029 histoneChips.chips(5) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH3K36me3'</span>);
0030 histoneChips.chips(6) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH3K79me3'</span>);
0031 histoneChips.chips(7) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH3K9me3'</span>);
0032 histoneChips.chips(8) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH3ac'</span>);
0033 histoneChips.chips(9) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipH4ac'</span>);
0034 histoneChips.chips(10) = <a href="#_sub1" class="code" title="subfunction [chip] = parseHistoneUCSCData(chipLabel)">parseHistoneUCSCData</a>(<span class="string">'encodeSangerChipCTCF'</span>);
0035 
0036 save GM06990chips_chrm7.mat histoneChips;
0037 
0038 
0039 <a name="_sub1" href="#_subfunctions" class="code">function [chip] = parseHistoneUCSCData(chipLabel)</a>
0040 
0041 <span class="keyword">global</span> chip;
0042 <span class="comment">%global nChip;</span>
0043 chip = struct(<span class="string">'label'</span>,{},<span class="string">'values'</span>,{}, <span class="string">'sample'</span>, {}, <span class="keyword">...</span>
0044     <span class="string">'region'</span>, struct (<span class="string">'label'</span>, {},<span class="string">'chrm'</span>, {},<span class="string">'start'</span>,{},<span class="string">'stop'</span>, {}) );
0045 
0046 <span class="comment">%[r,nChip] = size(chip);</span>
0047 
0048 <span class="comment">%chip(nChip+1).label = chipLabel;</span>
0049 chip(1).label = chipLabel;
0050 
0051 <span class="comment">% Encode data covering chrm 7</span>
0052 <a href="#_sub2" class="code" title="subfunction readEncodeRegions(chrm,start,stop,chipLabel)">readEncodeRegions</a>(<span class="string">'7'</span>,<span class="string">'115404472'</span>,<span class="string">'117281897'</span>,chipLabel); <span class="comment">% ENm001 chr7:115,404,472-117,281,897</span>
0053 <a href="#_sub2" class="code" title="subfunction readEncodeRegions(chrm,start,stop,chipLabel)">readEncodeRegions</a>(<span class="string">'7'</span>,<span class="string">'26730761'</span>,<span class="string">'27230760'</span>,chipLabel); <span class="comment">% ENm010 chr7:26,730,761-27,230,760</span>
0054 <a href="#_sub2" class="code" title="subfunction readEncodeRegions(chrm,start,stop,chipLabel)">readEncodeRegions</a>(<span class="string">'7'</span>,<span class="string">'113527084'</span>,<span class="string">'114527083'</span>,chipLabel); <span class="comment">% ENm012 chr7:113,527,084-114,527,083</span>
0055 <a href="#_sub2" class="code" title="subfunction readEncodeRegions(chrm,start,stop,chipLabel)">readEncodeRegions</a>(<span class="string">'7'</span>,<span class="string">'89428340'</span>,<span class="string">'90542763'</span>,chipLabel); <span class="comment">% ENm013 chr7:89,428,340-90,542,763</span>
0056 <a href="#_sub2" class="code" title="subfunction readEncodeRegions(chrm,start,stop,chipLabel)">readEncodeRegions</a>(<span class="string">'7'</span>,<span class="string">'125672607'</span>,<span class="string">'126835803'</span>,chipLabel); <span class="comment">% ENm014 chr7:125,672,607-126,835,803</span>
0057 
0058 
0059 <a name="_sub2" href="#_subfunctions" class="code">function readEncodeRegions(chrm,start,stop,chipLabel)</a>
0060 
0061 <span class="keyword">global</span> chip;
0062 <span class="comment">%global nChip;</span>
0063 [xmlS, xml] = executeDASCommand(<span class="string">'http://hgwdev-gencode.cse.ucsc.edu/cgi-bin/das'</span>,<span class="string">'command'</span>, <span class="string">'features'</span>, <span class="string">'DSN'</span>, <span class="string">'hg18'</span>,<span class="string">'chrom'</span>,chrm,<span class="string">'start'</span>,start <span class="keyword">...</span>
0064     , <span class="string">'stop'</span>, stop, <span class="string">'featuresList'</span>,{chipLabel});
0065 
0066 
0067 nFeatures = size(xmlS.GFF{1}.SEGMENT{1}.FEATURE,2);
0068 values = zeros(nFeatures,1);
0069 nRegions = size(chip(1).region,2);
0070 
0071 <span class="keyword">for</span> i=1:nFeatures
0072     
0073     <span class="comment">%chipLabel = xmlS.GFF{1}.SEGMENT{1}.FEATURE{i}.METHOD{1}.CONTENT;</span>
0074     values(i) = str2double(xmlS.GFF{1}.SEGMENT{1}.FEATURE{i}.SCORE{1}.CONTENT);
0075     chip(1).region(i+nRegions).chrm = <span class="string">'7'</span>;
0076     chip(1).region(i+nRegions).start = xmlS.GFF{1}.SEGMENT{1}.FEATURE{i}.START{1}.CONTENT;
0077     chip(1).region(i+nRegions).stop = xmlS.GFF{1}.SEGMENT{1}.FEATURE{i}.END{1}.CONTENT;
0078 <span class="keyword">end</span>
0079 
0080 chip(1).values = [chip(1).values ; values];
0081 chip(1).sample = [<span class="string">'GM06990'</span> chipLabel(17:end)]; <span class="comment">%cell line and histone modification</span>
0082 
0083 
0084 
0085 
0086 
0087 
0088 
0089 
0090 
0091</pre></div>
<hr><address>Generated on Tue 17-Feb-2009 16:59:45 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>